package com.hxd.mall.module.school.article

import com.alibaba.android.arouter.facade.annotation.Route
import com.hxd.mall.R
import com.hxd.mall.base.BaseInjectActivity
import com.hxd.mall.constant.HxdConstants.IntentParamsKeyDefine.key_web_url
import com.hxd.mall.constant.HxdConstantsRouterPath.Common.path_to_webview
import com.hxd.mall.constant.HxdConstantsRouterPath.School.path_school_article
import com.hxd.mall.module.school.bean.ModuleLayout
import com.hxd.mall.utils.local.NavigationUtil.routerNavigation
import com.hxd.mall.utils.local.getListAdapter
import com.hxd.mall.utils.local.getModule
import com.hxd.mall.utils.open.GsonUtil
import com.hxd.mall.utils.open.initGridRecyclerView
import com.hxd.mall.utils.open.initRecyclerView
import kotlinx.android.synthetic.main.fragment_school_layout.*

/**
 * 新手必看 更多页
 */
@Route(path = path_school_article)
class ArticleActivity : BaseInjectActivity<IArticlePresenter>(), IArticleView {

    override fun attachLayoutRes(): Int = R.layout.activity_article_list_layout

    override fun initViews() {
        //setTitleCommon(getString(R.string.bird_must_scan))
    }

    override fun initData() {
        val moduleLayout = getModule(intent.getStringExtra("list"))
        if (moduleLayout != null) {
            val title =
                if (moduleLayout.title.isEmpty()) getString(R.string.bird_must_scan) else moduleLayout.title
            setTitleCommon(title)

            articleList.initGridRecyclerView(getListAdapter(moduleLayout.resources, ArticleAllListAdapter()), 12,6)
        }
    }

    override fun showData() {
    }

}
